package com.example.wac.constant;

/**
 * @author wuancheng
 * @description
 * @date 2022-01-04 09:36:00
 */

public interface Constant {

    String PREFIX = "wac:redis:";

    String TRANSACTION_ID = "transactionId";

    interface Email {
        /**
         * 发送时间范围限制 60秒
         */
        String TINE_RANGE_LIMIT = "email.time.range.limit";
        /**
         * 邮件发送次数限制 3次
         */
        String SEND_COUNT = "email_send.count";
    }

    interface Token {
        /**
         * 过期时间
         */
        String EXPIRE_TIME = "token.expire.time";
        /**
         * 秘钥
         */
        String SECRET = "token.secret";
        /**
         * 保存当前登录用户的时间
         */
        Long USER_LIMIT_TIME = 86400L;
    }

    /**
     * 当前登录用户key
     */
    String CURRENT_USER = "CURRENT_USER";

    interface Lock {
        /**
         * 普通单机锁
         */
        String SINGLE_LOCK = "single_lock";

        /**
         * 分布式锁
         */
        String DISTRIBUTE_LOCK = "distribute_lock";
    }

    interface ExcelTemplate {
        /**
         * 文件前缀
         */
        String PREFIX = "templates/";
        /**
         * 商品信息导出
         */
        String GOODS_EXPORT = PREFIX + "GoodsExportTemplate.xlsx";
        /**
         * 允许上传的Excel最大单元数量
         */
        int MAX_EXCEL_COUNT = 500;
    }

    interface Sms {
        String regionId = "cn-hangzhou";

        String accessKeyId = "LTAI4GCMh9iDzrWddzejNtfc";

        String secret = "IpjpL0s2h3AVv9ohcEFLNqKfdHs8YO";

        int SMS_MOBILE_COUNT = 5;

        int SMS_IP_COUNT = 10;

        String templateCode = "SMS_202551658";

        String signName = "成成学Java";
    }

    interface RedisKey {

        String MOBILE_LIMIT_COUNT_KEY = "mobile:%s";

        String MOBILE_DAY_LIMIT_COUNT_KEY = "mobile:day:%s";

        String IP_LIMIT_COUNT_KEY = "ip:%s";

        String LOGIN_USER = "shiro:login:user:%s";

        String ACCESS_TOKEN_KEY = "weChatAccessToken";

        String KEY_WECHAT_CODE_OPENID = "wechat:code:openid:{0}";
    }

    interface Login {
        String USER_UN_AUTHENTICATE = "您尚未登录，请先登录";

        String USER_UN_AUTHORIZE = "您没有访问权限";

        /**
         * 超级管理员权限码
         */
        String SUPER_ADMIN_PERMS = "**";

        /**
         * 记住我
         */
        String REMEMBER = "rememberMe";

        /**
         * 记住我时间 一天
         */
        int REMEMBER_TIME = 60 * 60 * 24;
    }

    interface WeChat {

        String appId = "wx4de0e3e0ada987ea";

        String appSecret = "dd9f348ecb88917aeb3b3394a6ad3480";

        String token = "wac";

        interface Message {
            /* ===================================================请求消息类型==================================================== */
            /**
             * 文本
             */
            public static final String REQ_MESSAGE_TYPE_TEXT = "text";
            /**
             * 图片
             */
            public static final String REQ_MESSAGE_TYPE_IMAGE = "image";
            /**
             * 语音
             */
            public static final String REQ_MESSAGE_TYPE_VOICE = "voice";
            /**
             * 视频
             */
            public static final String REQ_MESSAGE_TYPE_VIDEO = "video";
            /**
             * 小视频
             */
            public static final String REQ_MESSAGE_TYPE_SHORTVIDEO = "shortvideo";
            /**
             * 地理位置
             */
            public static final String REQ_MESSAGE_TYPE_LOCATION = "location";
            /**
             * 链接
             */
            public static final String REQ_MESSAGE_TYPE_LINK = "link";
            /**
             * 事件推送
             */
            public static final String REQ_MESSAGE_TYPE_EVENT = "event";
            /**
             * 事件类型--订阅
             */
            public static final String EVENT_TYPE_SUBSCRIBE = "subscribe";
            /**
             * 取消订阅
             */
            public static final String EVENT_TYPE_UNSUBSCRIBE = "unsubscribe";
            /**
             * 已关注用户扫描带参数二维码
             */
            public static final String EVENT_TYPE_SCAN = "SCAN";
            /**
             * 上报地理位置
             */
            public static final String EVENT_TYPE_LOCATION = "LOCATION";
            /**
             * 自定义菜单事件
             */
            public static final String EVENT_TYPE_CLICK = "CLICK";

            /* ===================================================响应消息类型==================================================== */

            /**
             * 文本
             */
            public static final String RESP_MESSAGE_TYPE_TEXT = "text";
            /**
             * 图片
             */
            public static final String RESP_MESSAGE_TYPE_IMAGE = "image";
            /**
             * 语音
             */
            public static final String RESP_MESSAGE_TYPE_VOICE = "voice";
            /**
             * 视频
             */
            public static final String RESP_MESSAGE_TYPE_VIDEO = "video";
            /**
             * 音乐
             */
            public static final String RESP_MESSAGE_TYPE_MUSIC = "music";
            /**
             * 图文
             */
            public static final String RESP_MESSAGE_TYPE_ARTICLE = "news";
        }
    }
}
